home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
dskut
/
diskread.zip
/
INT13.ASM
< prev
next >
Wrap
Assembly Source File
|
1986-10-22
|
11KB
|
186 lines
TITLE INT13
PAGE ,132
;********************************************************************
;* *
;* INT13 Version 1.0 10/21/86 *
;* *
;* Copyright 1986 Michael L. Brown *
;* Nicolet Instrument Corp *
;* 5225 Verona Rd *
;* Madison, WI 53711 *
;* (608) 273-5039 *
;* *
;* The user is hereby granted permission to use this program. *
;* User may not sell program. User may change and distribute this *
;* program, but may not charge for it. This program may be used *
;* in other programs, but may not charge extra for its inclusion. *
;* *
;* See the BASIC program DISKREAD.BAS for where to send corrections,*
;* enhancements, etc. *
;* *
;********************************************************************
PAGE
;********************************************************************
;* *
;* An assembly language interface to the BASIC program DISKREAD, *
;* which allows the BASIC program to read absolute hard disk *
;* sectors. *
;* *
;* BASIC syntax is: *
;* *
;* CALL INT13(ES%,BX%,AL%,AH%,CL%,CH%,DL%,DH%) *
;* *
;* The registers work as follows: *
;* *
;* AL% Number of sectors to read/write *
;* AH% The DISKBIOS INT 13h operation: *
;* 00 Reset disk/diskette *
;* 01 Read status of last disk operation into AL% *
;* 02 Read sectors into memory *
;* 03 Write sectors into memory *
;* 04 Verify the sectors *
;* 05 Format the track *
;* 06 Format the track & set bad sector flags *
;* 07 Format the drive starting at track *
;* 08 Return the current drive parameters *
;* 09 Initialize drive pair characteristics *
;* INT 41 points to data block *
;* 0A Read long *
;* 0B Write long *
;* 0C Seek *
;* 0D Alternate disk reset (see DL) *
;* 0E Read sector buffer *
;* 0F Write sector buffer *
;* 10 Test drive ready *
;* 11 Recalibrate *
;* 12 Controller RAM diagnostics *
;* 13 Drive diagnostics *
;* 14 Controller internal diagnostics *
;* CL% Sector number (1-17, not checked) *
;* CH% Cylinder number (0-1023, not checked) *
;* DL% Drive number (80h-87h for disk, checked) *
;* DH% Head number (0-7, not checked) *
;* *
;* The cylinder (track) number is 10 bits, so the upper 2 bits *
;* of the cylinder number are placed in the top 2 bits of CL%. *
;* The remaining 8 bits are placed into CH%. Even tho CL% and CH% *
;* are 16 bit BASIC integers, to the 8088, CL and CH are 8 bits. *
;* *
;********************************************************************
PAGE
;********************************************************************
;* *
;* When the INT13 program returns to BASIC, the following values *
;* are passed back: *
;* *
;* AH% The DISKBIOS INT 13h error numbers: *
;* 00 Operation OK *
;* 01 Bad command *
;* 02 Bad address mark *
;* 04 Record not found *
;* 05 Bad reset *
;* 07 Init failure *
;* 09 DMA boundary *
;* 0B Bad cylinder (track) *
;* 10 Bad ECC *
;* 11 Data corrected AL% contains burst length *
;* 20 Bad controller *
;* 40 Bad seek *
;* BB Undefined error *
;* FF Sense failure *
;* ES% Segment location of data *
;* BX% Offset location of data *
;* *
;* If disk parameters wanted: *
;* *
;* CL% Maximum useable sector & top 2 cylinder bits *
;* CH% Bottom 8 bits of cylinder number *
;* DL% Number of known drives attached *
;* DH% Maximum useable head number *
;* *
;* Assemble this code using the MASM assembler: *
;* *
;* MASM INT13,,INT13; *
;* *
;********************************************************************
PAGE
PARMLST STRUC
SAVE_BP DW ? ;Save contents of BP
RET_OFF DW ? ;Return address of calling program
RET_SEG DW ?
REGDH DW ? ;Offset from DS of 8th argument
REGDL DW ? ;Offset from DS of 7th argument
REGCH DW ? ;Offset from DS of 6th argument
REGCL DW ? ;Offset from DS of 5th argument
REGAH DW ? ;Offset from DS of 4th argument
REGAL DW ? ;Offset from DS of 3rd argument
REGBX DW ? ;Offset from DS of 2nd argument
REGES DW ? ;Offset from DS of 1st argument
PARMLST ENDS
PARM_SIZE EQU REGES - REGDH + TYPE REGES
CODE SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:CODE,DS:CODE
BUF